package com.fortune.rainshine.controller;

import com.fortune.rainshine.feign.system.CardFeign;
import com.fortune.rainshinecommon.base.MsgModel;
import com.fortune.rainshinecommon.model.system.CardModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: rainShine
 * @description:
 * @author: tangyn
 * @create: 2019-06-09
 **/
@RestController
@RequestMapping("cardController")
public class CardController {
    @Autowired
    private CardFeign cardFeign;

    @ResponseBody
    @RequestMapping("/getAllCards")
    public MsgModel getAllCards(){
        List<CardModel> list = cardFeign.getAllCards();
        return new MsgModel(list.size(), list);
    }
}
